%macro get_f1099int;


	proc printto new log = "&logdir./get_f1099int.txt";
	run;


	/****************************************************
	*			Put individuals into a tinlist			*
	****************************************************/
	%make_tinlist;


	

			options errors = 0;
				proc sql noprint;
				[connection details redacted]
					create table sample as
					select * from connection to iq 
					(
					select 
						a.[redacted] as person_id,
						a.[redacted] as f1099int_int,
						a.[redacted] as wh
					from [redacted] as a
						inner join #tinlist as b
							on(a.[redacted] = b.person_id)
					where a.[redacted] = &base_yr
						and a.[redacted]<=4
					);
				disconnect from iq;
				quit;




		/****************************
		*		Take a proc sum		*
		****************************/
		proc means data = sample nway noprint;
			class person_id;
			output out = rlib.f1099int(drop=_type_ _freq_)
				sum(f1099int_int wh) = 
					f1099int_int f1099int_wh;
	

	proc printto;
	run;

	


%mend;
